﻿using System;
using System.Collections.Generic;
using System.Text;

namespace _018传值_输出_引用_数组_具名_可选参数_7___数组参数
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //int[] myIntArray = new int[] { 1, 2, 3, 4, 5, 6 };
            //int result = CalculateSum(1,2,3,4,5,6);
            //Console.WriteLine(result);

            string str = "Tim;Tom,Amy.Lisa";
            string[] result = str.Split(';', ',', ',');
            foreach (string item in result)
            {
                Console.WriteLine(item);
            }
        }

        static int CalculateSum(params int[] intArray)
        {
            int sum = 0;
            for (int i = 0; i < intArray.Length; i++)
            {
                sum += intArray[i];
            }
            return sum;
        }
    }
}
